package goover.unit03;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class StreamDemo01 {
    public static void main(String[] args){
        Integer[] arr = {2,5,9,3,5};
        List<Integer> list = Arrays.asList(arr);
        Stream<Integer> stream = list.stream();
        stream.forEach(i -> System.out.print(i + " "));
        Stream<Integer> stream1 = Stream.of(arr);
        System.out.println();
        stream1.forEach(i -> System.out.print(i + " "));
        Stream<Integer> stream2 = Arrays.stream(arr);
        System.out.println();
        stream2.forEach(i -> System.out.print(i + " "));
    }
}
